<?php
/**
 * Created by PhpStorm.
 * User: http
 * Date: 2018/7/13
 * Time: 15:36
 */

namespace Document\Model\Article\Home;


class GetAttractionsArticleModel
{

    private $model;
    private $documentModel;

    public function __construct()
    {
        $this->model = new \Document\Model\Article\DocumentAttractionsModel();
        $this->documentModel = $this->model->getDocumentModel();
    }

    public function get()
    {
        $select = [ 'title', 'cover_id' ,'id'];
        $where = [
            'category_id' => $this->model->getCategoryId(),
            'display' => 1,
			'model_id' => $this->model->getModelId(),
			'status'=>1
        ];
        return $this->documentModel->field( $select )->where( $where )->order('id desc' )->limit(1)->select();
    }

}